import React, { Component } from 'react'
/***
 *  通过封装antd中的Spin
 *  来实现样式和位置的设置
 */
import { Spin } from 'antd'
import styled from 'styled-components'
export default class Loading extends Component {
  static defaultProps = {
    size: 'large',
    tip: '加载中...',
    spinning: true
  }
  render() {
    return (
      <Main>
        <Spin
          size={this.props.size}
          spinning={this.props.spinning}
          tip={this.props.tip}
        ></Spin>
      </Main>
    )
  }
}
const Main = styled.div`
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
`
